package com.ego.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ego.common.exception.GlobalException;
import com.ego.common.to.member.MemberTo;
import com.ego.common.vo.PageVo;
import com.ego.common.vo.WeeklyDataVo;
import com.ego.member.po.Member;
import com.ego.member.vo.MemberLoginVo;
import com.ego.member.vo.MemberRegisterVo;
import com.ego.member.vo.MemberSearchVo;

import java.util.List;
import java.util.Map;

/**
 * @author KamTang
 * @program: ego
 * @description 会员服务层
 * @date 2022-11-13 13:28:12
 */
public interface MemberService extends IService<Member> {
    /**
     * 搜索会员
     *
     * @param search @see
     * @return 会员
     * @see MemberSearchVo
     */
    PageVo<Member> search(MemberSearchVo search);

    /**
     * 注册
     * @param register @see
     * @throws GlobalException 用户信息是否重复
     * @see MemberRegisterVo
     */
    void register(MemberRegisterVo register) throws GlobalException;

    /**
     * 会员登录
     * @param login @see
     * @return @see
     * @see MemberLoginVo
     * @see Member
     */
    Member login(MemberLoginVo login);

    /**
     * 社交用户登录
     * @param memberTo 用户信息
     * @return @see
     * @see Member
     */
    Member oauth2Login(MemberTo memberTo);

    /**
     * 获取周用户注册数量
     * @return @see
     * @see WeeklyDataVo
     */
    Map<String, List<?>> getWeeklyRegisterData();
}

